package com.cloud.observer;

/**
 * @author: create by God of SJF
 * @version: v1.0
 * @description: com.cloud.observer
 * @date:2021/1/13
 */
public class ScheduledObserverCleanPool implements Runnable {

    ScheduledInfo scheduledInfo;

    BaseScheduledObserver baseScheduledObserver;

    public ScheduledObserverCleanPool(ScheduledInfo scheduledInfo, BaseScheduledObserver baseScheduledObserver) {
        this.scheduledInfo = scheduledInfo;
        this.baseScheduledObserver = baseScheduledObserver;
    }

    @Override
    public void run() {
        synchronized (scheduledInfo){
            scheduledInfo.errorSet.clear();
            baseScheduledObserver.map.put(scheduledInfo.getName(),scheduledInfo);
        }
    }
}
